//给你单链表的头结点 head ，请你找出并返回链表的中间结点。

//如果有两个中间结点，则返回第二个中间结点。
//1、暴力求解
typedef struct ListNode* ListNode;
struct ListNode* middleNode(struct ListNode* head)
{
    ListNode cru = head;
    int count = 0;
    while (cru)
    {
        count++;
        cru = cru->next;
    }
    cru = head;
    for (int i = 0; i < count / 2; i++)
    {
        cru = cru->next;
    }
    return cru;
}
//2、快慢指针
typedef struct ListNode* ListNode;
struct ListNode* middleNode(struct ListNode* head)
{
    ListNode FAST = head;
    ListNode SLOW = head;
    while (FAST && FAST->next)//用来区别奇偶链表
    {
        SLOW = SLOW->next;
        FAST = FAST->next->next;
    }
    return SLOW;
}